package com.sinosoft.shopcar;

import java.util.List;

import com.sinosoft.base.GenericManager;

public interface ShopcarManager extends GenericManager<Shopinfo, Long> {
	
public List<Shopinfo> getShopcarList(String username,int pagesize,int page);
	
	/**
	 * 保存或者修改购物车信息
	 * @param shopinfo
	 * @return
	 */
	public Shopinfo saveShopcar(Shopinfo shopinfo);
	
	/**
	 * 保存购物车，返回json串
	 * @param shopinfolist
	 * @return
	 */
	public String SaveShopcarList(List<Shopinfo> shopinfolist);
	
	/**
	 * 删除购物车列表
	 * @param shoplist
	 */
	public void removeShopcarlist(List<Shopinfo> shoplist);
	
	/**
	 * 根据购物车ids(id1,id2,id3)获取购物车列表
	 * @param ids
	 * @return
	 */
	public List<Shopinfo> getShopinfoListByIds(String ids);
	
	/**
	 * 根据购物车id删除购物车信息
	 * @param id
	 */
	public void removeShopcar(String id);
	
	/**
	 * 根据购物车ID获取购物车信息
	 * @param id
	 * @return
	 */
	public Shopinfo getShopinfoById(int id);
	
	/**
	 * 根据用户名获取购物车列表
	 * @param username
	 * @return
	 */
	public List<Shopinfo> getShopcarListByUsername(String username,String orderids);
	
	/**
	 * 根据sql语句获取购物车信息的总条数
	 * @param hql
	 * @return
	 */
	public int getShopcarCount(String username);
	
	/**
	 * 添加产品到购物车
	 * @param level 产品级别
	 * @param keys([satellite_sensorid_productid,satellite1_sensorid1_productid1])
	 * @return
	 */
	public List<Shopinfo> saveShopcarListByProductInfo(final String level, final String keys);
}
